package com.sright.bcard.content.biz.service;

import com.sright.bcard.common.service.share.dto.LoginUser;
import com.sright.bcard.content.biz.manager.TagManager;
import com.sright.bcard.common.service.share.dto.content.TagDTO;
import com.sright.bcard.content.share.service.TagService;
import com.sright.common.response.SrightResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class TagServiceImpl implements TagService {

    @Autowired
    private TagManager tagManager;

    @Override
    public SrightResponse<Long> addTag(String name, LoginUser loginUser) {
        return SrightResponse.defaultSuccess(tagManager.addTag(name, loginUser));
    }

    @Override
    public SrightResponse<Boolean> removeTag(Long id, LoginUser loginUser) {
        return SrightResponse.defaultSuccess(tagManager.removeTag(id, loginUser));
    }

    @Override
    public SrightResponse<List<TagDTO>> listTag(String name, LoginUser loginUser) {
        return SrightResponse.defaultSuccess(tagManager.listTag(name, loginUser));
    }
}
